package com.ajk.server.model;

public enum CreditsCategory {
	UNKNOW(0,"未知",0,1),
  	SIGN_IN(1,"每日签到",2,1),
  	PATIENT_EVENT_ADD(2,"添加健康数据",5,4),
  	FRIEND_ADD(3,"添加亲属关系",2,4),
  	TREAMENT_ADD(4,"添加就诊记录",2,4),
  	PERFECT_INFO(5,"完善个人资料",2,3),
  	REGISTER(6,"注册",10,3);

	private Integer value;
 	//分类名称
	private String name;
 	//积分数
	private Integer num;
 	//积分频率 dict_credits_frequency 表ID
	private Integer frequencyType;
	private CreditsCategory(Integer value, String name, Integer num, Integer frequencyType) {
		this.value = value;
		this.name = name;
		this.num = num;
		this.frequencyType = frequencyType;
	}
	public Integer getValue() {
		return value;
	}
	public void setValue(Integer value) {
		this.value = value;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getNum() {
		return num;
	}
	public void setNum(Integer num) {
		this.num = num;
	}
	public Integer getFrequencyType() {
		return frequencyType;
	}
	public void setFrequencyType(Integer frequencyType) {
		this.frequencyType = frequencyType;
	}
	
	public static CreditsCategory findCreditsCategoryByValue(int value){
		for(CreditsCategory eCategory : CreditsCategory.values()){
			if(value==eCategory.getValue()){
				return eCategory;
			}
		}
		return null;
	}
}
